package io.gitee.kotle.player.ui.view

import android.content.Context
import android.view.MotionEvent
import android.view.ScaleGestureDetector

class PlayerScaleGestureHelper(private val context: Context) :
    ScaleGestureDetector.SimpleOnScaleGestureListener() {
    private val scaleGesture by lazy { ScaleGestureDetector(context, this) }

    fun onTouchEvent(event: MotionEvent): Boolean {
        return scaleGesture.onTouchEvent(event)
    }

    override fun onScaleBegin(detector: ScaleGestureDetector): Boolean {
        return super.onScaleBegin(detector)
    }

    override fun onScaleEnd(detector: ScaleGestureDetector) {
        super.onScaleEnd(detector)
    }

    override fun onScale(detector: ScaleGestureDetector): Boolean {
        return super.onScale(detector)
    }
}